unit SmallStruct.BusinessObject;

interface

uses SmallStruct.Core,
  SmallStruct.Database,
  SmallStruct.Model,
  SmallStruct.Script,
  SmallStruct.Tools,
  Classes;

const
  SS_BUSINESS_OBJECT_FACTORY_NAME: string = 'BUSINESS_OBJECT_FACTORY';
  SS_SCRIPT_LOADER: string = 'SCRIPT_LOADER';

type
  ISSBusinessObjectContext = interface(ISSObjectContext)
    ['{81E633A2-C5D2-4C6D-A8B5-52552983A3DC}']
    function GetBusinessObjectContainer: ISSObjectContainer;
    function GetModelContainer: ISSObjectContainer;
    function GetSystemObject: ISSSystemObject;
  end;

  ISSBusinessObject = interface(ISSRuntimeObject)
    ['{BD6CD041-0340-4E4A-BCC6-C68F6F39DAE6}']
  end;

  ISSAdvancedBusinessObjectContext = interface(ISSBusinessObjectContext)
    ['{14B6D677-964B-42CF-87E5-8E38A9B1FF5B}']
    function GetDatabase: ISSDatabaseDriver;
  end;

  ISSAdvancedBusinessObject = interface(ISSBusinessObject)
    ['{D5545332-DBA0-4EC6-BCD3-882C7217843D}']
  end;

  ISSBusinessObjectFactory = interface(ISSObject)
    ['{2F6E9FAA-0F61-441D-8CF4-DC2473C5449F}']
    function GetBusinessObject(const ABusinessObjectName: string): ISSBusinessObject; overload;
    function GetBusinessObject(const ABusinessObjectConfiguration: ISSConfiguration): ISSBusinessObject; overload;
    procedure FreeBusinessObject(ABusinessObject: ISSBusinessObject);
  end;

  ISSActionFilter = interface(ISSAdvancedBusinessObject)
    ['{B03E2F0B-6BED-449B-B4FB-2B6CD46C28EE}']
    function Filter(const RequestActionViewName, RequestActionCaption, ResponseActionViewName: string): Boolean;
  end;

  ISSScriptBusinessObject = interface(ISSAdvancedBusinessObject)
    ['{B08B9194-AD5F-428F-9720-2A86E29FC642}']
    function Execute(Parameters: ISSRecord): Variant;
  end;

  ISSScriptBusinessObjectContext = interface(ISSAdvancedBusinessObjectContext)
    ['{6FE2344E-9236-483E-A2BB-01F4AB60A462}']
    function GetParameters: ISSRecord;
    function GetScript: ISSScript;
    procedure SetPrameters(Parameters: ISSRecord);
  end;

  ISSScriptLoader = interface(ISSAdvancedBusinessObject)
    ['{828A205C-2C4F-410A-8226-7D6E3D129A7D}']
    function LoadScript(const BusinessObjectName: string): ISSScript;
  end;

implementation

end.
